<?php
$this->load("header");
$this->navbar();
?>
<div class="bread_crumb" style="margin-top: -15px;margin-left: 30px;">
    &laquo;  <a href="manage_users">Back</a>
</div>
<link href = '<?php echo CSS_PATH . "user_details/style_table_1.css"; ?>' rel="stylesheet" >
<link href = '<?php echo CSS_PATH . "user_details/responsive_table.css"; ?>' rel="stylesheet" >
<form action="" method="POST">
    <div id="page-wrap" class="cover" style="margin-top:25px;clear: both">
        <!-- Single button -->
        <div class="group_select_desk" style="width: 90%;">
		   <div style="width:30%;float:left"><h4 style="color:blue;margin-left:10px">USERS</h4></div>
		   <div style="width:70%;display:block;float:left">
            <?php if (($_SESSION['Del'] == "Yes") or ($_SESSION['admin'] == 1)) { ?>  <div class="btn-group" style="float: right;">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        select <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="javascript:allCheck('chkDel[]',true)">Select All</a></li>
                        <li><a href="javascript:allCheck('chkDel[]',false)">Select None</a></li> 
                        <li><a href="javascript:reserveCheck('chkDel[]')" >Invert Select</a></li>
                    </ul>
                </div>

                <?php
            }
            if (($_SESSION['Del'] == "Yes") or ($_SESSION['admin'] == 1)) {
                ?>

                <div class="btn-group" style="margin-right: 10px;float: right">
                    <button type="submit" name="delete" class="btn btn-default" style="width:80px">
                        Delete 
                    </button>
                </div> 

                <?php
            }
            if (($_SESSION['Addd'] == "Yes") or ($_SESSION['admin'] == 1)) {
                ?>

                <div class="btn-group" style="margin-right: 10px;float: right">
                    <a href = "?add=<?php echo $this->data;?>" >
                        <button type="button" class="btn btn-default"  style="width:80px">
                            Add 
                        </button></a> </div>

                <?php
            }
            ?>
			</div>
        </div>
        <div class="group_select_mob">
      <h4 style="margin-left:30px;color:blue">USERS</h4>

            <?php
            if (($_SESSION['Del'] == "Yes") or ($_SESSION['admin'] == 1)) {
                ?>  <div class="btn-group" style="float: left;">
                    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#" >
                        Select&nbsp;
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="javascript:allCheck('chkDel[]',true)">Select All</a></li>
                        <li><a href="javascript:allCheck('chkDel[]',false)">Select None</a></li> 
                        <li><a href="javascript:reserveCheck('chkDel[]')" >Invert Select</a></li>
                    </ul>
                </div>
                <?php
            }
            ?>

            <div class="btn-group"  style="float: right">
                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#" >
                    Action&nbsp;
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu"  style="float:left;margin-left: -84px">
                    <!-- dropdown menu links -->
                    <?php
                    if (($_SESSION['Addd'] == "Yes") or ($_SESSION['admin'] == 1)) {
                        ?>
                        <li><a href="?add=1"><i class="icon-file"></i>New</a></li>
                    <?php } ?>
                    <li><a href=""><i class="icon-print"></i>Print</a></li> 
                    <li><a href="" ><i class="icon-list"></i>Report</a></li> 
<?php
if (($_SESSION['Del'] == "Yes") or ($_SESSION['admin'] == 1)) {
    ?>
                        <li><button type="submit" name="delete" style="border:none;background:none;margin-left: 20px">Delete</button></li>
                        <?php
                    }
                    ?>
                    <li><a href="" ><i class="icon-list-alt"></i>VAT Report</a></li> 
                    <li><a href="" ><i class="icon-th"></i>Options</a></li> 
                </ul>
            </div>
        </div><br><br>
        <table  class="table1" id="table_pro">
            <thead  class="thead1">
                <tr>
                    <td>&nbsp;</td>
                    <th>Modules</th>
                    <th>Add</th>  
                     <th>Delete</th>  
                </tr>
            </thead>
            <tbody>
<?php
foreach ($this->reslt as $key => $value) {
    ?>
                    <tr>
                        <td><input type="checkbox" name="chkDel[]" id="chkDel<?= $i; ?>" value="<?php echo $value['p_id']; ?>"></td>
                        <td style="overflow-wrap: break-word">

    <?php
    if (($_SESSION['Edit'] == "Yes") or ($_SESSION['admin'] == 1)) {

        echo '<a href=?edit=' . $value['p_id'] . '>' . $value['module'] . '</a>';
    } else {
        echo $value['module'];
    }
    ?>
                        <td><?php echo $value['Addd']; ?></td>
                        <td><?php echo $value['Del']; ?></td>
                        <td><?php echo $value['Edit']; ?></td>
                    </tr>
                <?php
                }
                $_SESSION['suserid'] = $value['userid'];
                //echo $_SESSION['suserid'];
                ?>

            </tbody>
        </table>

    </div>
</form>
<?php
$this->load("footer");
?>
